package com.jxj.controller;

import com.jxj.dao.SocResumeMsgMapper;
import com.jxj.entity.GetSocResumeVo;
import com.jxj.entity.Resp;
import com.jxj.entity.SocResumeVO;
import com.jxj.util.GetSocMapping;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.Map;

@RestController
@Slf4j
public class SocResumeMsgController {

    @Resource
    private SocResumeMsgMapper socResumeMsgMapper;

    @GetMapping("/getststinfor")
    public Resp<GetSocResumeVo> getSocResumeMsg(int id)
    {
        GetSocResumeVo getSocResumeVo = socResumeMsgMapper.selectSocResumeById(id);

        Map<Integer, String> map = GetSocMapping.getMap();

        log.debug("\n------\n{}\n------\n" , (map.get(Integer.parseInt(getSocResumeVo.getSocieties_num_1()))));
        getSocResumeVo.setSocieties_name_1(map.get(Integer.parseInt(getSocResumeVo.getSocieties_num_1())));
        getSocResumeVo.setSocieties_name_2(map.get(Integer.parseInt(getSocResumeVo.getSocieties_num_2())));

        return new Resp<>(HttpStatus.OK,getSocResumeVo);
    }
}
